package com.zx.map.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.zx.map.dao.model.MerchantCertificateInfo;
import com.zx.map.dao.model.MerchantInfo;
import com.zx.map.dao.model.MerchantInfoExample;
import com.zx.map.dao.model.MerchantTerminalInfo;

/**
 * Created by IntelliJ IDEA. User: ������ Date: 15-5-12 Time: ����14:11
 * �̻�����ݿ���ز���
 */
public interface MerchantInfoDao {

	/**
	 * 新增
	 * 
	 * @param MerchantInfo
	 * @return
	 * @throws DataAccessException
	 */
	public String add(MerchantInfo merchantInfo) throws DataAccessException;

	/**
	 * 更新
	 * 
	 * @param MerchantInfo
	 * @return
	 * @throws DataAccessException
	 */
	public String update(MerchantInfo merchantInfo) throws DataAccessException;

	/**
	 * 删除
	 * 
	 * @param MerchantInfo
	 * @throws DataAccessException
	 */
	public void delete(MerchantInfo merchantInfo) throws DataAccessException;

	/**
	 * 分页查询
	 * 
	 * @param pageSize
	 * @param pageBegin
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public List<MerchantInfo> getPageByExample(int pageSize, int pageBegin,
			MerchantInfoExample example) throws DataAccessException;

	/**
	 * 根据Model查找List
	 * 
	 * @param pageSize
	 * @param pageBegin
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public List<MerchantInfo> getListByExample(MerchantInfoExample example)
			throws DataAccessException;

	/**
	 * 查找条数
	 * 
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public int countByExample(MerchantInfoExample example)
			throws DataAccessException;

	/**
	 * 根据单Key查找Model
	 * 
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public MerchantInfo selectByPrimaryKey(String key)
			throws DataAccessException;

	/**
	 * 新增商户终端关联表
	 * 
	 * @param merchantId
	 * @param terminalId
	 * @throws DataAccessException
	 */
	public void addMerchantTerminalInfo(String merchantId, String terminalId)
			throws DataAccessException;
	public void deleteMerchantTerminalInfo(String merchantId)
			throws DataAccessException;

	/**
	 * 新增商户证件信息关联表
	 * 
	 * @param merchantId
	 * @param terminalId
	 * @throws DataAccessException
	 */
	public void addMerchantCertificateInfo(MerchantCertificateInfo record)
			throws DataAccessException;
	public void updateMerchantCertificateInfo(MerchantCertificateInfo record)
			throws DataAccessException;
	public MerchantCertificateInfo getMerchantCertificateInfo(String merchantId)
			throws DataAccessException;
	/**
	 * 根据商户获得绑定的终端关联表
	 */
	public List<MerchantTerminalInfo> getMerchantTerminalInfoByMerchantId(String merchantId)
			throws DataAccessException;

	/**
	 * 更改用户从属
	 * @param fromAgentId
	 * @param toAgentId
	 * @return
	 */
	int updateBelong(String fromAgentId, String toAgentId);

	public List<String> getMerchantIdList(MerchantInfoExample example);
}
